/*
 * @Author: 高瑞寒 15932717091@163.com
 * @Date: 2022-06-19 09:45:32
 * @LastEditTime: 2022-06-20 00:53:49
 * @LastEditors: 高瑞寒 15932717091@163.com
 * @Description:
 */
import {
  createRouter,
  createWebHistory
  //  createWebHashHistory
} from 'vue-router'

const routes = [
  {
    path: '/hello',
    name: 'hello-admin',
    component: () => import('../views/HelloAdmin.vue')
  },
  {
    path: '/welcome',
    name: 'welcome',
    component: () => import('../views/WelCome.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/views/404.vue')
  },
  { path: '/:pathMatch(.*)', redirect: '/404', hideMenu: true }
]

console.log(window.__POWERED_BY_QIANKUN__)

const router = createRouter({
  history: createWebHistory(window.__POWERED_BY_QIANKUN__ ? '/child' : ''),
  // process.env.NODE_ENV === "production" ? createWebHistory() : createWebHashHistory(),
  // createWebHistory(process.env.BASE_URL),
  routes
})

export default router
